projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f096d6
)
Help static analysis with an assertion
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 26 May 2020 00:38:16 +0000
(20:38 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 26 May 2020 00:56:09 +0000
(20:56 -0400)
It is hard for clang to see that layouts will
always be smaller than num_layouts, so just assert
that.
gdk/wayland/gdkkeys-wayland.c
patch
|
blob
|
history
diff --git
a/gdk/wayland/gdkkeys-wayland.c
b/gdk/wayland/gdkkeys-wayland.c
index 802463298e5a547cecd2fcd42486a59df8445013..ef41b287ef0c5cd2a569b70d3a4c32622d93407a 100644
(file)
--- a/
gdk/wayland/gdkkeys-wayland.c
+++ b/
gdk/wayland/gdkkeys-wayland.c
@@
-412,6
+412,7
@@
update_direction (GdkWaylandKeymap *keymap)
gint layouts, layout;
layouts = xkb_keymap_num_layouts_for_key (keymap->xkb_keymap, key);
+ g_assert (layouts <= num_layouts);
for (layout = 0; layout < layouts; layout++)
{
const xkb_keysym_t *syms;